package dao;

import my.framework.dao.CommonDao;
import pojo.Auction;

import java.sql.SQLException;
import java.util.List;

public class TestDao extends CommonDao {

    public List<Auction> getAuctions(Auction auction) throws SQLException {
        String sql="select `auctionId`, `auctionName`," +
                " `auctionStartPrice`, `auctionUpset`, " +
                "`auctionStartTime`, `auctionEndTime`," +
                " `auctionPic`, `auctionPicType`, `auctionDesc" +
                "` from auction";
        List<Auction> auctions=super.executeQuery(Auction.class,sql,auction);
        return auctions;
    }

    public static void main(String[] args) {

        try {
            TestDao testDao=new TestDao();
            List<Auction> list=testDao.getAuctions(null);
            list.forEach(auction -> System.out.println(auction));
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
